package com.naiterui.ehp.bs.doctor.enums;

/**
 * 商务代表 职务枚举
 * @Author Gaoll
 * @Date 2015年10月31日
 */
public enum BusinessTitleEnum {

    // 1.大区经理;2.省经理;3.城经理;4.商务代表
    AREA (1, "大区经理"),
    PROVINCE (2, "省经理"),
    CITY (3, "城经理"),
    NORMAL (4, "商务代表"),
    PARTTIME (5, "兼职代表");

    private int code;
    private String msg;

    BusinessTitleEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    /**
     * 根据code获取枚举
     * @param index
     * @return
     */
    public static BusinessTitleEnum getTitleEnumByCode(int index) {
        BusinessTitleEnum[] totalEnums = BusinessTitleEnum.class.getEnumConstants();
        for (BusinessTitleEnum tempEnum : totalEnums) {
            if (tempEnum.getCode() == index) {
                return tempEnum;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
